<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Goods/index')}">商品管理列表显示</a></li>
        <li><a href="{:url('Goods/add')}">添加商品管理列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('Goods/index')}">
        <input type="text" class="form-control" name="price" style="width: 200px;" value="{:input('request.price/s','')}" placeholder="请输入标题或作者">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a >
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('Goods/order')}">
        <div class="table-actions">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">排序</button>
        </div>
        <table class="table table-hover table-bordered table-list">
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th width="50">{:lang('SORT')}</th>
                <th width="50">ID</th>
                <th width="150">商品</th>
                <th width="50">封面</th>
                <th width="50">图片</th>
                <th width="50">运费</th>
                <th width="50">分类</th>
                <th width="50">运营</th>
                <th width="150">商品状态</th>
                <th width="150">创建时间</th>
                <th width="50">{:lang('ACTIONS')}</th>
            </tr>

            <tbody>
                <foreach name="list" item="v">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value=""></td>
                    <td><input type="text" name="list_orders[{$v.id}]" value="{$v.list_order}" style="width: 50px;"></td>
                    <td>{$v.id}</td>
                    <td>{$v.price}</td>
                    <td ><img class="img-thumbnail" src="/upload/{$v.image}" style="width: 80px;height: 40px; "/></td>
                    <td>
                        <foreach name="$v['photos_url']" item="vo">
                            <img src="/upload/{$vo}" style="width: 40px">
                        </foreach>

                    </td>
                    <td>{$v.yf}</td>
                    <td>{$v.gid}</td>
                    <td>
                        <eq name="$v.type" value="0">
                            <button href="{:url('Goods/change',array('id'=>$v['id']))}" class="btn btn-primary js-ajax-dialog-btn" data-msg="确定要改为官方旗舰店吗">自营</button>
                            <else/>
                            <button href="{:url('Goods/change',array('id'=>$v['id']))}" class="btn btn-success js-ajax-dialog-btn" data-msg="确定要改为自营吗">官方旗舰店</button>
                        </eq>
                    </td>
                    <td>
                        <if $v.status == 0><div class="btn btn-success">上架</div></if>
                        <if $v.status == 1><div class="btn btn-danger">下架</div></if>
                        <if $v.status == 2><div class="btn btn-primary">补货</div></if>
                    </td>
                    <td>{$v.create_time}</td>
                    <td>
                        <div class="btn-group" role="group">
                            <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                商品配置<span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="javascript:void(0);" onclick="openIframeLayer('setGoodsAttr?goods_id={$v.id}','配置商品属性',{area:['60%','80%']})">
                                        配置属性
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" onclick="openIframeLayer('setGoodsAttrValue?goods_id={$v.id}','配置商品属性值',{area:['60%','80%']})">
                                        配置属性值
                                    </a>
                                </li>
                            </ul>
                        </div>

                        <a class="btn btn-xs btn-primary" href="{:url('Goods/edit',array('id'=>$v['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Goods/delete',array('id'=>$v['id']))}">
                            {:lang('DELETE')}
                        </a>
                    </td>
                </tr>
                </foreach>
            </tbody>
        </table>
        <div>
            共有{$list->total()}条数据，每页显示{$list->listRows()}条，当前第{$list->currentPage()}页，共{$list->lastPage()}页
        </div>
        <div class="pagination">{$list->render()}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script src="__STATIC__/js/js-image-previewer.js?v={$_static_version}"></script>
</body>
</html>
